<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="学生管理系统"/>
    <meta name="keywords" content="学生管理系统"/>
    <meta name="author" content="LANG"/>

    <!--<link href="/favicon.ico" rel="icon" type="image/x-icon"/>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/>-->

    <title>查询职工信息-HRMS</title>

    <!--mdui css-->
    <link th:href="@{/lib_web/mdui/css/mdui.min.css}" rel="stylesheet">

    <link th:href="@{/css/common.css}" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .mdui-checkbox {
            padding-right: 10px;
        }

        .mdui-p-a-1 {
            min-width: 60px;
        }
    </style>
</head>
<body class="mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-indigo mdui-theme-accent-pink">
<header class="mdui-appbar mdui-appbar-fixed">
    <div class="mdui-toolbar mdui-color-theme">
        <a href="javascript:" class="mdui-btn mdui-btn-icon" mdui-drawer="{target: '#left-drawer'}"><i
                class="mdui-icon material-icons">menu</i></a>
        <p>哈信息人力资源管理系统</p>
        <div class="mdui-toolbar-spacer"></div>
        <a href="javascript:window.location.reload();" class="mdui-btn mdui-btn-icon"><i
                class="mdui-icon material-icons">refresh</i></a>
    </div>
</header>

<nav class="mdui-drawer mdui-card" id="left-drawer">
    <div class="mdui-card-media">
        <img th:src="@{/image/card.jpg}"/>
        <div class="mdui-card-media-covered">
            <div class="mdui-card-primary">
                <div class="mdui-card-primary-title" sec:authentication="name">舒露</div>
                <div class="mdui-card-primary-subtitle">欢迎</div>
            </div>
        </div>
    </div>
    <ul class="mdui-list mdui-card-content" mdui-collapse="{accordion: true}">
        <li th:if="${departmentList.size()!=0}" class="mdui-collapse-item mdui-collapse-item-open">
            <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">people</i>
                <div class="mdui-list-item-content">职工信息管理</div>
                <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
            </div>
            <div class="mdui-collapse-item-body mdui-list mdui-list-dense mdui-list-item-active">
                <a th:href="@{/staffInfo/search}" class="mdui-list-item mdui-ripple">查询职工信息</a>
            </div>
            <div th:each="department : ${departmentList} " class="mdui-collapse-item-body mdui-list mdui-list-dense">
                <!--/*@thymesVar id="id" type="java.lang.String"*/-->
                <a th:id="${department.id}" th:href="${'/index/#/'+department.id}" th:text="${department.name}"
                   class="mdui-list-item mdui-ripple">1602班</a>
            </div>
        </li>

        <li th:if="${departmentList.size()!=0}" class="mdui-collapse-item">
            <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">attach_money</i>
                <div class="mdui-list-item-content">职工工资管理</div>
                <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
            </div>
            <div class="mdui-collapse-item-body mdui-list mdui-list-dense">
                <a th:href="@{/staffWage/search}" class="mdui-list-item mdui-ripple">查询工资信息</a>
                <a th:href="@{/staffWage/add}" class="mdui-list-item mdui-ripple">添加工资信息</a>
            </div>
        </li>
        <li class="mdui-list-item mdui-ripple" id="postTitle">
            <i class="mdui-list-item-icon mdui-icon material-icons">nature_people</i>
            <a th:href="${'/manage/#/postTitle'}" class="mdui-list-item-content">岗位名称管理</a>
        </li>
        <li class="mdui-list-item mdui-ripple" id="postCategory">
            <i class="mdui-list-item-icon mdui-icon material-icons">nature</i>
            <a th:href="${'/manage/#/postCategory'}" class="mdui-list-item-content">岗位类别管理</a>
        </li>
        <li class="mdui-list-item mdui-ripple" id="jobTitle">
            <i class="mdui-list-item-icon mdui-icon material-icons">accessibility</i>
            <a th:href="${'/manage/#/jobTitle'}" class="mdui-list-item-content">社会职称管理</a>
        </li>
        <li class="mdui-list-item mdui-ripple" id="jobLevel">
            <i class="mdui-list-item-icon mdui-icon material-icons">bubble_chart</i>
            <a th:href="${'/manage/#/jobLevel'}" class="mdui-list-item-content">职称级别管理</a>
        </li>
        <li class="mdui-list-item mdui-ripple" id="employmentForm">
            <i class="mdui-list-item-icon mdui-icon material-icons">dvr</i>
            <a th:href="${'/manage/#/employmentForm'}" class="mdui-list-item-content">用工形式管理</a>
        </li>
        <li class="mdui-list-item mdui-ripple" id="department">
            <i class="mdui-list-item-icon mdui-icon material-icons">transfer_within_a_station</i>
            <a th:href="${'/manage/#/department'}" class="mdui-list-item-content">部门信息管理</a>
        </li>
        <li th:if="${departmentList.size()!=0}" class="mdui-collapse-item">
            <div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
                <i class="mdui-list-item-icon mdui-icon material-icons">equalizer</i>
                <div class="mdui-list-item-content">基层单位管理</div>
                <i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
            </div>
            <div th:each="department : ${departmentList} " class="mdui-collapse-item-body mdui-list mdui-list-dense">
                <!--/*@thymesVar id="id" type="java.lang.String"*/-->
                <a th:id="${department.id}" th:href="${'/grassroot/#/'+department.id}" th:text="${department.name}"
                   class="mdui-list-item mdui-ripple">1602班</a>
            </div>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <label class="mdui-switch">
                <input type="checkbox" id="night_mode"/>
                <i class="mdui-switch-icon"></i>
            </label>
            <div class="mdui-list-item-content">夜间模式</div>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">settings</i>
            <a href="" class="mdui-list-item-content">系统设置</a>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <i class="mdui-list-item-icon mdui-icon material-icons">vpn_key</i>
            <a th:href="@{/logout}" class="mdui-list-item-content">注销登陆</a>
        </li>
    </ul>
</nav>
<section class="mdui-container">

    <form id="search_form" th:action="@{/studentLeave/searchLeave}" method="get">
        <div class="mdui-table-fluid">
            <table id="search_table" class="mdui-table" style="width: 100%">
                <tr>
                    <td class="mdui-col-xs-8">
                        <div class="mdui-textfield mdui-textfield-floating-label">
                            <i class="mdui-icon material-icons">account_box</i>
                            <label class="mdui-textfield-label" id="show_info">请输入要查询的姓名</label>
                            <input name="name" type="text" class="mdui-textfield-input"/>
                        </div>
                    </td>
                    <td class="mdui-col-xs-2 mdui-m-t-1" style="width: 10%"><label class="mdui-checkbox">
                        <input type="checkbox" name="sex" value="true"/>
                        <i class="mdui-checkbox-icon"></i>
                        男
                    </label>
                        <label class="mdui-checkbox">
                            <input type="checkbox" name="sex" value="false"/>
                            <i class="mdui-checkbox-icon"></i>
                            女
                        </label></td>
                    <td class="mdui-col-xs-2 mdui-p-t-2">
                        <input type="button" onclick="search()" style="height: 70px;"
                               class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent mdui-btn-block"
                               value="查询"/>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-6">
                        <div class="mdui-textfield mdui-textfield-floating-label">
                            <i class="mdui-icon material-icons">credit_card</i>
                            <label class="mdui-textfield-label">请输入要查询的银行卡号</label>
                            <input name="bankID" type="number" class="mdui-textfield-input"/>
                        </div>
                    </td>
                    <td class="mdui-col-xs-6">
                        <div class="mdui-textfield mdui-textfield-floating-label">
                            <i class="mdui-icon material-icons">email</i>
                            <label class="mdui-textfield-label">请输入要查询的邮箱</label>
                            <input name="email" type="email" class="mdui-textfield-input"/>
                        </div>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-6">
                        <div class="mdui-textfield mdui-textfield-floating-label">
                            <i class="mdui-icon material-icons">crop_landscape</i>
                            <label class="mdui-textfield-label">请输入要查询的身份证号</label>
                            <input name="nid" type="text" class="mdui-textfield-input"/>
                        </div>
                    </td>
                    <td class="mdui-col-xs-6">
                        <div class="mdui-textfield mdui-textfield-floating-label">
                            <i class="mdui-icon material-icons">phone_android</i>
                            <label class="mdui-textfield-label">请输入要查询的电话号</label>
                            <input name="tel" type="number" class="mdui-textfield-input"/>
                        </div>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">岗位工资开始:</p></td>
                    <td class="mdui-col-xs-4"><input name="startWage" type="number" class="mdui-textfield-input"></td>
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">岗位工资结束:</p></td>
                    <td class="mdui-col-xs-4"><input name="endWage" type="number" class="mdui-textfield-input"></td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">绩效工资开始:</p></td>
                    <td class="mdui-col-xs-4"><input name="startPerformancePay" type="number"
                                                     class="mdui-textfield-input"></td>
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">绩效工资结束:</p></td>
                    <td class="mdui-col-xs-4"><input name="endPerformancePay" type="number"
                                                     class="mdui-textfield-input"></td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">出生日期开始:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly" id="showstartdate"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'startb',maxDate:'#F{$dp.$D(\'endb\')}'})"/><input
                            id="startb" name="startBirthday" type="text" class="mdui-hidden"></td>
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">出生日期结束:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly" id="showenddate"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'endb',minDate:'#F{$dp.$D(\'startb\')}'})"/><input
                            id="endb" name="endBirthday" type="text" class="mdui-hidden"></td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">来校日期开始:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'startc',maxDate:'#F{$dp.$D(\'endc\')}'})"/><input
                            id="startc" name="startComeDate" type="text" class="mdui-hidden"></td>
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">来校日期结束:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'endc',minDate:'#F{$dp.$D(\'startc\')}'})"/><input
                            id="endc" name="endComeDate" type="text" class="mdui-hidden"></td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">工龄起始日期开始:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'startDate',maxDate:'#F{$dp.$D(\'endDate\')}'})"/><input
                            id="startDate" name="startDate" type="text" class="mdui-hidden"></td>
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">工龄起始日期结束:</p></td>
                    <td class="mdui-col-xs-4"><input readonly="readonly"
                                                     class="mdui-textfield-input"
                                                     type="text" maxlength="10"
                                                     onfocus="WdatePicker({skin:'twoer',dateFmt:'yyyy年MM月dd日',vel:'endDate',minDate:'#F{$dp.$D(\'startDate\')}'})"/><input
                            id="endDate" name="endDate" type="text" class="mdui-hidden"></td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-1"><p class="mdui-p-a-1">岗位名称:</p></td>
                    <td class="mdui-col-xs-11" id="positionTitle">
                        <a href="javascript:clearChecked('positionTitle')" style="margin-right: 30px"
                           class="mdui-btn mdui-ripple"
                        >不限</a>
                        <label class="mdui-checkbox" th:each="positionTitle:${positionTitleInfoList}">
                            <input type="checkbox" name="positionTitle" th:value="${positionTitle.id}"/>
                            <i class="mdui-checkbox-icon"></i>
                            <span th:text="${positionTitle.name}"></span>
                        </label>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-1"><p class="mdui-p-a-1">岗位类别:</p></td>
                    <td class="mdui-col-xs-11" id="positionCategory">
                        <a href="javascript:clearChecked('positionCategory')" style="margin-right: 30px"
                           class="mdui-btn mdui-ripple"
                        >不限</a>
                        <label class="mdui-checkbox" th:each="positionCategory:${positionCategoryInfoList}">
                            <input name="positionCategory" type="checkbox" th:value="${positionCategory.id}"/>
                            <i class="mdui-checkbox-icon"></i>
                            <span th:text="${positionCategory.name}"></span>
                        </label>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-1"><p class="mdui-p-a-1">社会职称:</p></td>
                    <td class="mdui-col-xs-11" id="_jobTitle">
                        <a href="javascript:clearChecked('_jobTitle')" style="margin-right: 30px"
                           class="mdui-btn mdui-ripple"
                        >不限</a>
                        <label class="mdui-checkbox" th:each="jobTitle:${jobTitleInfoList}">
                            <input name="jobTitle" type="checkbox" th:value="${jobTitle.id}"/>
                            <i class="mdui-checkbox-icon"></i>
                            <span th:text="${jobTitle.name}"></span>
                        </label>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-1"><p class="mdui-p-a-1">职称级别:</p></td>
                    <td class="mdui-col-xs-11" id="_jobLevel">
                        <a href="javascript:clearChecked('_jobLevel')" style="margin-right: 30px"
                           class="mdui-btn mdui-ripple"
                        >不限</a>
                        <label class="mdui-checkbox" th:each="jobLevel:${jobLevelInfoList}">
                            <input name="jobLevel" type="checkbox" th:value="${jobLevel.id}"/>
                            <i class="mdui-checkbox-icon"></i>
                            <span th:text="${jobLevel.name}"></span>
                        </label>
                    </td>
                </tr>
                <tr class="mdui-m-t-5">
                    <td class="mdui-col-xs-2"><p class="mdui-p-a-1">部门:</p></td>
                    <td class="mdui-col-xs-10" id="_department">
                        <label class="mdui-checkbox" th:each="department:${departmentList}">
                            <input name="department" type="checkbox" th:data-index="${departmentStat.index}"
                                   th:data-name="${department.name}"
                                   th:value="${department.id}"/>
                            <i class="mdui-checkbox-icon"></i>
                            <span th:text="${department.name}"></span>
                        </label>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <div class="mdui-typo">
        <hr/>
    </div>
    <div class="mdui-progress mdui-hidden" id="loading_progress">
        <div class="mdui-progress-indeterminate"></div>
    </div>
    <div class="mdui-table-fluid data-table mdui-hidden">
        <table id="result" class="mdui-table mdui-table-selectable mdui-table-hoverable">
            <thead>
            <tr>
                <th style="min-width: 115px">姓名</th>
                <th style="min-width: 210px">基层单位</th>
                <th>性别</th>
                <th>年龄</th>
                <th style="min-width: 115px">民族</th>
                <th style="min-width: 150px">政治面貌</th>
                <th>出生日期</th>
                <th>身份证号码</th>
                <th>邮箱</th>
            </tr>
            </thead>
            <tbody id="table_data"></tbody>
        </table>
    </div>
    <div class="mdui-card data-table mdui-hidden">
        <div class="mdui-card-content">
            <button id="down_select_btn" onclick="down_select()"
                    class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" disabled>选中下载
            </button>
            <button id="del_select_btn" onclick="del_select(false)" sec:authorize="hasAuthority('A')"
                    class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent" disabled>选中删除
            </button>
        </div>
    </div>
    <div class="mdui-dialog" id="show_alert">
        <div class="mdui-dialog-title">确定删除吗?</div>
        <div class="mdui-dialog-content">这会删除该生请假信息!</div>
        <div class="mdui-dialog-actions">
            <button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
            <button class="mdui-btn mdui-ripple" onclick="del_select(true)" mdui-dialog-close>确认</button>
        </div>
    </div>
    <button onclick="search()" class="mdui-fab mdui-color-theme-accent mdui-ripple mdui-fab-fixed"><i
            class="mdui-icon material-icons">search</i></button>
</section>
<script th:src="@{/lib_web/jquery/jquery-3.2.1.min.js}"></script>
<script th:src="@{/lib_web/mdui/js/mdui.min.js}"></script>
<script th:src="@{/js/common.js}"></script>
<script th:src="@{/lib_web/datepicker/WdatePicker.js}"></script>
<script th:inline="javascript">
    'use strict';
    /*日期格式化方法*/
    Date.prototype.format = function (fmt) {
        var o = {
            "M+": this.getMonth() + 1,                 //月份
            "d+": this.getDate(),                    //日
            "h+": this.getHours(),                   //小时
            "m+": this.getMinutes(),                 //分
            "s+": this.getSeconds(),                 //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds()             //毫秒
        };
        if (/(y+)/.test(fmt)) {
            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        }
        for (var k in o) {
            if (new RegExp("(" + k + ")").test(fmt)) {
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
            }
        }
        return fmt;
    };

    $(function () {
        //部门基层单位联动
        var departmentList = [[${departmentList}]];
        $('#_department').find("input[type='checkbox']").each(function () {
            var that = $(this);
            $(that).click(function () {
                if ($(that).prop("checked")) {
                    $('#search_table').append("<tr id='gr-" + $(that).val() + "' class=\"mdui-m-t-5\"><td class=\"mdui-col-xs-2\"><p class=\"mdui-p-a-1\">" + $(that).data('name') + "部门:</p></td><td id='grassroots-" + $(that).val() + "' class=\"mdui-col-xs-10\"></td></tr>");
                    for (var i = 0; i < departmentList[$(that).data('index')].grassroots.length; i++) {
                        $('#grassroots-' + $(that).val()).append("<label class=\"mdui-checkbox\"><input name=\"grassroot\" type=\"checkbox\" value='" + departmentList[$(that).data('index')].grassroots[i].id + "'/><i class=\"mdui-checkbox-icon\"></i><span>" + departmentList[$(that).data('index')].grassroots[i].name + "</span></label>");
                    }
                } else {
                    $('#gr-' + $(that).val()).remove();
                }
            })
        })
    });

    function after() {
        /*根据复选框是否选中设置按钮是否可用*/
        var $downSelectBtn = $('#down_select_btn');
        var $delSelectBtn = $('#del_select_btn');
        $("thead .mdui-checkbox input:checkbox").click(function () {
            if ($(this).prop('checked')) {
                $downSelectBtn.removeAttr('disabled');
                $delSelectBtn.removeAttr('disabled');
            } else {
                $downSelectBtn.attr("disabled", "disabled");
                $delSelectBtn.attr("disabled", "disabled");
            }
        });
        $('tbody .mdui-checkbox input:checkbox').click(function () {
            var hasChecked = false;
            $('.mdui-checkbox input:checkbox').each(function () {
                if ($(this).prop('checked')) {
                    hasChecked = true;
                }
            });
            if (hasChecked) {
                $downSelectBtn.removeAttr('disabled');
                $delSelectBtn.removeAttr('disabled');
            } else {
                $downSelectBtn.attr("disabled", "disabled");
                $delSelectBtn.attr("disabled", "disabled");
            }
        });
    }

    /*取消选择*/
    function clearChecked(id) {
        $('#' + id).find("input[type=checkbox]").prop('checked', false);
    }

    //进度条状态
    function progressStatus(b) {
        var $loadingProgress = $("#loading_progress");
        if (b) {
            $loadingProgress.removeClass("mdui-hidden");
        } else {
            $loadingProgress.addClass("mdui-hidden");
        }
    }

    function show_tables(b) {
        var $data = $('.data-table');
        if (b) {
            $data.removeClass("mdui-hidden");
        } else {
            $data.addClass("mdui-hidden");
        }
    }

    function search() {
        var $searchForm = $('#search_form');
        for (var i = 0; i < $searchForm.serializeArray().length; i++) {
            if ($searchForm.serializeArray()[i].value !== "") {
                progressStatus(true);
                show_tables(false);
                $.get('/staffInfo/searchStaff?' + $searchForm.serialize(), function (data) {
                    $("#table_data").html("");
                    if (data.length !== 0) {
                        $.each(data, function (i, n) {
                            $("#table_data").append("<tr data-id=\"" + n.id + "\"><td><a href=\"/staffInfo/showDetails/" + n.id + "\" target=\"_blank\" class=\"\">" + n.name + "</a></td><td>" + n.grassroot.name + "</td><td>" + (n.sex ? "男" : "女") + "</td><td>" + n.age + "</td><td>" + n.ethnic.name + "</td><td>" + n.ps.name + "</td><td>" + ((new Date(n.birthday)).format("yyyy.MM.dd")) + "</td><td>" + n.nid + "</td><td>" + n.email + "</td></tr>")
                        });
                        show_tables(true);
                        mdui.updateTables();
                        after();
                    }
                    progressStatus(false);
                });
                break;
            }
        }
    }

    function del_select(b) {
        if (b) {
            $('.mdui-table-row-selected').each(function () {
                var del_id = $(this).data('id');
                console.log('删除-->' + del_id);
                $.get("/studentLeave/del/" + del_id, function (data) {
                    if (data.code === 200) {
                        console.log('删除-->' + del_id + "成功");
                        $('#' + del_id).remove();
                    } else {
                        alert('删除-->' + del_id + "失败\nCODE:" + data.code + "\nMSG:" + data.msg + "\nURL:" + data.url);
                        console.error('删除-->' + del_id + "失败\nCODE:" + data.code + "\nMSG:" + data.msg + "\nURL:" + data.url);
                    }
                });
            });
        } else {
            new mdui.Dialog('#show_alert').open();
        }
    }
</script>
</body>
</html>